import { createRouter, createWebHistory } from 'vue-router'
import homePage from "@/components/homePage.vue";
import home from "@/views/home.vue";
import service from "@/components/service.vue";
import contact from "@/components/contact.vue";
import about from "@/components/about.vue";
import Register from "@/views/register/index.vue";
import WorkSpace from "@/views/index.vue"
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import("@/views/login/index.vue")
    },
    {
      path: '/register',
      name: 'register',
      redirect: '/register/step1',
      component: Register,
      children: [
        {
          path: 'step1',
          name: 'step1',
          component: () => import("@/views/register/step1.vue")
        },
        {
          path: 'step2',
          name: 'step2',
          component: () => import("@/views/register/step2.vue")
        },
        {
          path: 'step3',
          name: 'step3',
          component: () => import("@/views/register/step3.vue")
        },
        {
          path: 'step4',
          name: 'step4',
          component: () => import("@/views/register/step4.vue")
        },
      ]
    },
    {
      path: '/workspace',
      name: 'workspace',
      redirect: '/workspace/classify',
      component: WorkSpace,
      children: [
        {
          path: 'classify',
          name: 'classify',
          component: () => import("@/views/classify/index.vue")
        }
      ]
    },
    {
      path: "/registersuccess",
      name: "registersuccess",
      component: () => import("@/views/register/stepSuccess.vue")
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      children:[
        {
          path: '/home/homePage',
          name: 'homePage',
          component: homePage,
        },
        {
          path: '/home/service',
          name: 'service',
          component: service,
        },
        {
          path: '/home/contact',
          name: 'contact',
          component:contact,
        },
        {
          path: '/home/about',
          name: 'about',
          component:about,
        }
      ]
    },
    {
      path:'/discern',
      name:'discern',
      component: () => import("@/components/discern.vue")
    },
    {
      path:'/data',
      name:'data',
      component: () => import("@/components/data.vue")
    },
    {
      path:'/manage',
      name:'manage',
      component: () => import("@/components/manage.vue")
    },
    {
      path:'/monitor',
      name:'monitor',
      component: () => import("@/components/monitor.vue")
    },
    {
      path:'/english',
      name:'english',
      component: () => import("@/components/english.vue"),
    },
    {
      path:'/service2',
      name:'service2',
      component: () => import("@/components/service2.vue"),
    },
    {
      path:'/contact2',
      name:'contact2',
      component: () => import("@/components/contact2.vue"),
    },
    {
      path:'/about2',
      name:'about2',
      component: () => import("@/components/about2.vue"),
    },
    {
      path:'/discern2',
      name:'discern2',
      component: () => import("@/components/discern2.vue")
    },
    {
      path:'/manage2',
      name:'manage2',
      component: () => import("@/components/manage2.vue")
    },
    {
      path:'/data2',
      name:'data2',
      component: () => import("@/components/data2.vue")
    }

  ]
})

export default router
